#ifndef DATAFILE_H_
#define DATAFILE_H_

#include "System\F2806x_Device.h"

struct SDataFile
{
	// Controller Inputs
	bool Active;
	Uint32 Mode;
	bool AckError;
	float Vref;
	float Iref;
	float RPMref;
	float POSref;

	// Controller Outputs
	Uint32 ActualState;
	Uint32 ActualMode;
	float ElAngle;

	// Other Data
	float BattVoltage; // converted
	float Temperature; // converted
	float Id;
	float Iq;
	float SpeedRPM;
	float PositionN;

	// ADC Data
	Uint16 CurrentA; // ADC
	Uint16 CurrentB; // ADC
	Uint16 CurrentC; // ADC
	Uint16 Voltage; // ADC
	Uint16 NTC; // ADC
	float CurrentAF; // converted
	float CurrentBF; // converted
	float CurrentCF; // converted

	// Tuning (LVL9...LVL12)
	Uint16 lsw;
	Uint16 Init_IFlag;
	float VoltageVd;
	float CurrentId;
	int16 DebugSquareGenTicks;

	// DEBUG
	int16 PwmDacCh1;
	int16 PwmDacCh2;
	int16 PwmDacCh3;
	int16 PwmDacCh4;
	int16 DlogCh1;
	int16 DlogCh2;
	int16 DlogCh3;
	int16 DlogCh4;

	// Status
	Uint32 IsrTicker;
	Uint32 Counter;
	float INTLoopTimeUS; // [us]
	float INTLoopTimeUSMAX; // [us]
	float LoopTimeMS; // [ms]
	float LoopTimeMSMAX; // [ms]
	float64 MissionTime; // [s]
};

#endif /*DATAFILE_H_*/
